package com.mycompany.myapp.service;

import com.mycompany.myapp.domain.SUser;
import com.mycompany.myapp.service.dto.SUserDTO;
import com.mycompany.myapp.service.dto.SUserInfoDTO;
import com.mycompany.myapp.web.rest.utils.ResultObj;
import com.mycompany.myapp.web.rest.vm.QueryVM;
import org.springframework.data.domain.Page;

import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Optional;

/**
 * Service Interface for managing {@link com.mycompany.myapp.domain.SUser}.
 */
public interface SUserService {

    /**
     * Save a sUser.
     *
     * @param sUserDTO the entity to save.
     * @return the persisted entity.
     */
    SUserDTO save(SUserDTO sUserDTO);

    /**
     * Get all the sUsers.
     *
     * @return the list of entities.
     */
    List<SUserDTO> findAll();


    /**
     * Get the "id" sUser.
     *
     * @param id the id of the entity.
     * @return the entity.
     */
    Optional<SUserDTO> findOne(Long id);

    /**
     * Delete the "id" sUser.
     *
     * @param id the id of the entity.
     */
    void delete(Long id);

    ResultObj registerUser(SUserDTO sUserDTO, String password);

    List<SUserInfoDTO> findAllSUser();

    Optional<SUser> findOneByPhone(String phone);

    ResultObj updateSUser(SUserDTO sUserDTO);

    ResultObj sendEmail(String Email, HttpSession session);

    ResultObj alterPassword(String verifycode,String password,HttpSession session);

    ResultObj checkEmail(String email);

    ResultObj findSUserByUsername(String username);

    ResultObj findSUser(String username,String password);

    ResultObj changePassword(Long userId, String password);

    Page<SUser> findByName(int pageNum, int pageSize, String username);

    ResultObj updateState(long userId, boolean isActive);

    SUserInfoDTO findById(Long id);

    ResultObj updateSUserM(SUserDTO sUser);

    ResultObj updateRole(Long id, String role);
}
